
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBJsonToModel/YBMapMiShuModel/YBMapMiShuModel.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBNetWorkModule/YBMapMiShuNetWork/YBMapMiShuNetWork.dart';

//三秘 地图 事务
class YBMapMiShuDiTuProvodier with ChangeNotifier {

  List<YBMapMiShuModel> mishuModelList = List<YBMapMiShuModel>();

  //标签内容
  void getMapLabel(String place,String parentCode,String refeffer){

    YBMapMiShuNetWork.mapmiShuTypeLabelList({
      "sysCode":"xg_jinrilvsi",
      "place":place,
      "parentCode":parentCode,
      "referrer":refeffer,
    },success: (data){
      print("秘书标签内容---$data-");
      var dataList = data;
      if (!ObjectUtil.isEmptyList(dataList)){
         mishuModelList.addAll(
             (dataList as List).map((e) => YBMapMiShuModel.fromJson(e)).toList(),
         );
         notifyListeners();
      }
    },fail: (error){
      print("object---$error-");
    });
  }

}


//三秘  处理事务
class YBMapMiShuBanliShiWuProvodier with ChangeNotifier {

  List<YBMapMiShuModel> mishuShiWuList = List<YBMapMiShuModel>();

  //标签内容
  void getMapLabel(String place,String parentCode){
    YBMapMiShuNetWork.mapmiShuTypeLabelList({
      "sysCode":"xg_jinrilvsi",
      "place":place,
      "parentCode":parentCode,
    },success: (data){
      print("秘书标签内容---$data-");
      var dataList = data;
      if (!ObjectUtil.isEmptyList(dataList)){
        mishuShiWuList.addAll(
          (dataList as List).map((e) => YBMapMiShuModel.fromJson(e)).toList(),
        );
        notifyListeners();
      }
    },fail: (error){
      print("object---$error-");
    });
  }

}